<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>代理商-商品管理-商品审核</title>
    <!--日期  css文件-->
    <link rel="stylesheet" type="text/css" href="js/datepicker/css/bootstrap-datepicker.css">
    <!--弹窗 css文件-->
    <link rel="stylesheet" type="text/css" href="js/layer/layer.css">
    <!--主要css样式-->
    <link rel="stylesheet" type="text/css" href="css/models.css">
    <style>
        .ph_tableBox .bootstrap-select.tableSelect:not(.input-group-btn), .ph_tableBox .bootstrap-select.tableSelect[class*="col-"] {
            width: 40%;
        }
    </style>
</head>
<body>
<div class="MainContent">
    <!--主体内容-->
    <div class="MainCont">
        <div class="ph_snbBtn">
            <button class="columnBtn" name="" value="刷新">刷新</button>
            <button class="columnBtn mul_pass" name="" value="批量通过">批量通过</button>
            <button class="columnBtn mul_unpass" name="" value="批量不通过">批量不通过</button>
        </div>
        <!--筛选条件-->
        <div class="ph_screen">
            <table class="ph_tableBox">
                <tr>
                    <th>提交时间：</th>
                    <td colspan="2"><p class="dayBox"><input class="start_rise date start" name="" type="text">&nbsp;-&nbsp;<input
                            class="start_rise date end" name="" type="text"></p></td>
                    <th>商品名称：</th>
                    <td><input name="" type="text"></td>
                    <th>店铺名称：</th>
                    <td><input name="" type="text"></td>
                    <td>
                        <input name="" type="button" value="搜索"><input name="" type="button" value="重置">
                    </td>
                </tr>
            </table>
        </div>
        <!--end 筛选条件-->
        <!--商品列表-->
        <div class="ph_wareBox ph_tabScroll">
            <table class="ph_wareList" id="example"></table>
        </div>
        <!--end 商品列表-->
    </div>
    <!--end 主体内容-->
</div>
<!--不通过原因弹窗-->
<div class="PopupBox" id="ph_returnBox">
    <!--内容-->
    <div class="ph_subPoCon">
        <form id="formID">
            <ul class="addList">
                <li><label for=""><span class="require">*</span>不通过说明：</label><textarea
                        class="validate[required] ph_txtAreaBg" name="" id="" cols="30" rows="10"></textarea></li>
            </ul>
        </form>
    </div>
    <!--end 内容-->
</div>
<!--end 不通过原因弹窗-->
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<!--日期控件-->
<script type="text/javascript" src="js/datepicker/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="js/datepicker/jquery.timepicker.js"></script>
<script type="text/javascript" src="js/datepicker/jquery.datepair.js"></script>
<script type="text/javascript" src="js/datepicker/datepicker.js"></script>
<!--分页-->
<script type="text/javascript" src="js/pages/jquery.dataTables.min.js"></script>
<!--验证-->
<script type="text/javascript" src="js/validat/jquery.validationEngine-zh_CN.js"></script>
<script type="text/javascript" src="js/validat/jquery.validationEngine.js"></script>
<!--弹窗-->
<script type="text/javascript" src="js/layer/layer.js"></script>
<script type="text/javascript">
    $(function () {
        //table点击和双击点击事件
        /*$('#example').on('click', 'tbody tr', function () {
            if($(this).hasClass('wareBg')){
                $(this).removeClass('wareBg');
                $(this).find('.ids').prop('checked',false);
            }else{
                $(this).addClass('wareBg');
                $(this).find('.ids').prop('checked',true);
            }
        });*/
        $("#formID").validationEngine({
            addPromptClass: 'formError-text',
            showArrow: false,
            promptPosition: 'bottomLeft:10 0'
        });
        //批量通过、不通过
        $('body').on('click', '.mul_pass', function () {
            $chose = $('.ids:checked');
            if ($chose.length!=0) {
                //这里写获取ID、操作代码
                layer.msg($chose.length+'批量通过')
            }else{
                layer.alert('批量操作选择内容为空，请重新选择')
            }
        });
        $('body').on('click', '.mul_unpass', function () {
            $chose = $('.ids:checked');
            if ($chose.length!=0) {
               //这里写获取ID、操作代码
                layer.msg($chose.length+'批量不通过')
            }else{
                layer.alert('批量操作选择内容为空，请重新选择')
            }
        });
        // 单个通过、不通过
        $('.ph_wareList').on('click', '.js_Frozen', function () {
            layer.confirm('确定此操作吗？', {
                title: '通过',
                icon: 2,
                btnAlign: 'c',
                closeBtn: 0
            }, function (index) {
                layer.alert('操作失败', {icon: 2, btnAlign: 'c', closeBtn: 0});
                //layer.close(index);
            });
        });
        //不通过原因
        $('.ph_wareList').on('click', '.Js_Enable', function () {
            layer.open({
                type: 1,
                title: '不通过说明',
                closeBtn: 1,
                area: ['460px', '270px'],
                //maxmin: true,
                btn: ['保存', '取消'],
                btnAlign: 'c',
                content: $('#ph_returnBox')
            });
        });
        $('#example').DataTable({
            "bServerSide": true,
            "sPaginationType": "full_numbers",
            //"bJQueryUI": true,
            "sDom": '<"">t<"F"ip>',
            "autoWidth": false,  //自适应宽度
            //"sAjaxSource": "${ctx}/api/user/list", //ajax调用接口
            //<div class="btn-group" style="text-align:left;"><button type="button" class="btn btn-info dropdown-toggle"data-toggle="dropdown">操作 <span class="caret"></span></button>
            "sAjaxSource": "data/arrays.txt", //ajax调用接口
            "aoColumnDefs": [{sDefaultContent: '', orderable: false, aTargets: ['_all']}],
            "aoColumns": [
                {
                    "sWidth": "30px",
                    "sTitle": "<input class= \"check-all\" name=\"\" type=\"checkbox\">",
                    "mData": "id",
                    "mRender": function () {
                        return '<input class="ids" name="" type="checkbox">';
                    }
                },
                {"sWidth": "50px", "sTitle": "序号", "mData": "id"},
                {"sWidth": "100px", "sTitle": "商品名称", "mData": "id1"},
                {"sWidth": "200px", "sTitle": "店铺名称", "mData": "id3"},
                {"sWidth": "200px", "sTitle": "店铺分类", "mData": "id3"},
                {"sWidth": "110px", "sTitle": "单价", "mData": "id4"},
                {"sWidth": "110px", "sTitle": "单位", "mData": "id5"},
                {"sWidth": "110px", "sTitle": "提交时间", "mData": "id6"},
                {
                    "sWidth": "110px",
                    "sTitle": "操作",
                    "mData": "id",
                    "sClass": "ph_tableShow",
                    "mRender": function (data, type, full) {
                        var text = '<div class="operateBox"><input class="operate" name="" type="button" value="操作选项">';
                        text += '<ul class="operateList hide" role="menu">';
                        text += '<li><a class="js_Frozen" href="javascript:void(0);">通过</a></li>';
                        text += '<li><a class="Js_Enable" href="javascript:void(0);">不通过</a></li>';
                        text += '</ul></div>';
                        return text;
                    }
                }
            ],
            "oLanguage": {
                "sProcessing": "数据加载中······",
                "sLengthMenu": "显示 _MENU_ 条记录",
                "sZeroRecords": "没有您要搜索的内容！",
                "sEmptyTable": "列表中无数据存在！",
                "sInfo": "当前显示 _START_ 到 _END_ 条数据，共 _TOTAL_ 条数据",
                "sInfoEmpty": "显示 0 到 0 条记录",
                "sInfoFiltered": "数据列表中共  _MAX_ 条记录",
                "oPaginate": {
                    "sFirst": "首页",
                    "sPrevious": "上一页",
                    "sNext": "下一页",
                    "sLast": "末页"
                }
            }
            /*"fnServerData" : function ( sSource, aoData, fnCallback, oSettings ) {
               oSettings.jqXHR = $.ajax( {
                   "dataType" 	: 'json',
                   "type" 		: "GET",
                   "async"     : 'false',
                   "url" 		: sSource,
                   "data" 		: {
                       'pageNum': (aoData[3].value/aoData[4].value)+1,
                       'pageSize' :  aoData[4].value,
                       'telphone'  :  $("#telphone").val(),
                       'isable' : $('#isable').val()
                   },
                   "success"	: fnCallback
               } );
           }*/
        });
    });
</script>
</body>
</html>